<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>放松放松发送到发送到服务费
    <!-- // 可以向文档写入html表达式 -->
    <script>
        function getSelectedText() {
            if(window.getSelection) {
                return window.getSelection().toString();

            }else if(document.selection){
                return document.selection.createRange().text;
            }
        }
        a = getSelectedText();
        console.log(a);
        
    </script>
    
</body>
</html>